import cn.edu.scnu.cs2020.huangrun.number;
import javax.swing.*;
import java.util.Scanner;

public class test
{
    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
        System.out.println("Do you want to enter the number? (Yes or No)");
        String whether=sc.nextLine();

        if(whether.equalsIgnoreCase("Yes"))
        {
            System.out.println("Enter the numerator");
            int a=sc.nextInt();
            System.out.println("Enter the denominator");
            int b=sc.nextInt();
            if(b==0)
            {
                System.out.println("You enter the wrong number!");
                return;
            }
            number test=new number(a,b);
            if(args!=null&&args.length>0)
            {
                System.out.println("The  type of String of rational number  is "+test.toString());
                System.out.println("The  type of double of rational number is "+test.getValue());
            }
            else
            {
                JOptionPane.showMessageDialog(null,"The type of String of rational number  is "+test.toString());
                JOptionPane.showMessageDialog(null,"The type of double rational number  is "+test.getValue());
            }
        }
        else
        {
            number test=new number();
            if(args!=null&&args.length>0)
            {
                System.out.println("The  type of String of rational number  is "+test.toString());
                System.out.println("The  type of double of rational number is "+test.getValue());
            }
            else
            {
                JOptionPane.showMessageDialog(null,"The type of String of rational number  is "+test.toString());
                JOptionPane.showMessageDialog(null,"The type of double rational number  is "+test.getValue());
            }
        }
    }
}

